package geometry;


public class Zone
{
	public int face;
	int borne12;
	int borne11;
	int borne21;
	int borne22;

	public PointSI	p1, p2, p3, p4;
	public float	color;
	
	public static int tab[] = {0, 0, 0, 0, 0, 0};
	
	public Zone(int face, int borne11, int borne12, int borne21, int borne22 , PointSI p1, PointSI p2, PointSI p3, PointSI p4 )
	{
		super();
		this.p1 = p1;
		this.p2 = p2;
		this.p3 = p3;
		this.p4 = p4;
		this.face = face;
		this.borne12 = borne12;
		this.borne11 = borne11;
		this.borne21 = borne21;
		this.borne22 = borne22;
		
		color = (float) Math.random();
		
		tab[face-1]++;
	}

	public Zone(int face )
	{
		this.face = face;
		
		tab[face-1]++;
	}

	public String toString()
	{
		String s = new String();
		s += "Zone : " + face + "\n";
		s += "Borne " + borne11 + " " + borne12 + "\n";
		s += "Borne " + borne21 + " " + borne22 + "\n";
		s += "Alt " + p1.alt + " " + p4.alt + "\n";
		s += "Alt " + p2.alt + " " + p3.alt;
		
		
		/*s += p1 + "\n";
		s += p2 + "\n";
		s += p3 + "\n";
		s += p4 + "\n";*/
		
		return s;
	}

	public void setB(int borne11, int borne12, int borne21, int borne22)
	{
		this.borne12 = borne12;
		this.borne11 = borne11;
		this.borne21 = borne21;
		this.borne22 = borne22;
	}

	public void setP(PointSI p1, PointSI p2, PointSI p3, PointSI p4)
	{
		this.p1 = p1;
		this.p2 = p2;
		this.p3 = p3;
		this.p4 = p4;
	}

	public void setA(double a1, double a2, double a3, double a4)
	{
		this.p1.alt = (float) a1;
		this.p2.alt = (float) a2;
		this.p3.alt = (float) a3;
		this.p4.alt = (float) a4;
	}

	public void appliquerAlt()
	{
		p1.appliquerAlt();
		p2.appliquerAlt();
		p3.appliquerAlt();
		p4.appliquerAlt();
	}
}
